import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { AuthService } from 'src/app/services/auth.service';
import * as constants from 'src/app/providers/Constants'
import { ToastService } from 'src/app/providers/toast/toast.service'
import { ActivatedRoute, Params } from '@angular/router';
import { ApiRead } from 'src/app/services/api.read';
import { NavParams } from '@ionic/angular';
@Component({
  selector: 'app-address-state-list',
  templateUrl: './address-state-list.component.html',
  styleUrls: ['./address-state-list.component.scss'],
})
export class AddressStateListComponent implements OnInit {
  defaultColumnOptions = [
  ]
  constructor(private activeRoute: ActivatedRoute,
    private auth: AuthService,
    private nav: NavParams,
    private apiRead: ApiRead,
    private toast: ToastService, private http: HttpClient) {

  }

  ngOnInit() {
    this.apiRead.getJSON('assets/json/EN.json').subscribe(res => {
      this.defaultColumnOptions = res;
      // this.provinces = res;
    })
  }
  onClick(str) {
    this.closeModel(str);
  }
  back(){
    this.closeModel('United States');
  }
  close() {
    this.closeModel('');
  }
  closeModel(str) {
    this.nav.data.modal.dismiss({
      'result': '消失的时候返回的内容',
      'str': str,
    });
  }

}
